package com.rawchen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rawchen.entity.VisitLog;
import com.rawchen.model.dto.VisitLogUuidTime;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description: 访问日志持久层接口
 */
@Mapper
@Repository
public interface VisitLogMapper extends BaseMapper<VisitLog> {
	/**
	 * 查询日志
	 *
	 * @param uuid      UUID，使用 %uuid% 来查询
	 * @param startDate 开始时间段
	 * @param endDate   结束时间段
	 */
	List<VisitLog> getVisitLogListByUUIDAndDate(String uuid, String startDate, String endDate);

	/**
	 * 查询昨天的所有访问日志
	 */
	List<VisitLogUuidTime> getUUIDAndCreateTimeByYesterday();

	/**
	 * 查询今日访问量
	 */
	int countVisitLogByToday();
}
